<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the load balancer service ID for the command</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongodb-driver-monitoring-commandfailedevent.getserverconnectionid.html">« MongoDB\Driver\Monitoring\CommandFailedEvent::getServerConnectionId</a></li>
      <li style="float: right;"><a href="class.mongodb-driver-monitoring-commandstartedevent.html">MongoDB\Driver\Monitoring\CommandStartedEvent »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongodb-driver-monitoring-commandfailedevent.html">MongoDB\Driver\Monitoring\CommandFailedEvent</a></li>
    <li>Returns the load balancer service ID for the command</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongodb-driver-monitoring-commandfailedevent.getserviceid" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\Driver\Monitoring\CommandFailedEvent::getServiceId</h1>
  <p class="verinfo">(mongodb &gt;=1.11.0)</p><p class="refpurpose"><span class="refname">MongoDB\Driver\Monitoring\CommandFailedEvent::getServiceId</span> &mdash; <span class="dc-title">Returns the load balancer service ID for the command</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-driver-monitoring-commandfailedevent.getserviceid-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\Driver\Monitoring\CommandFailedEvent::getServiceId</strong></span>(): <span class="type"><span class="type">?</span><span class="type"><a href="class.mongodb-bson-objectid.html" class="type MongoDB\BSON\ObjectId">MongoDB\BSON\ObjectId</a></span></span></div>

  <p class="para rdfs-comment">
   When the driver is connected to a MongoDB cluster through a load balancer,
   the service ID corresponds to the <code class="literal">serviceId</code> field in the
   <code class="literal">hello</code> command response.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-driver-monitoring-commandfailedevent.getserviceid-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-driver-monitoring-commandfailedevent.getserviceid-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the load balancer service ID, or <strong><code>null</code></strong> if the driver is not
   connected to a load balancer.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-driver-monitoring-commandfailedevent.getserviceid-errors">
  <h3 class="title">错误／异常</h3>
  <ul class="simplelist">
   <li class="member">Throws <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.html" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> on argument parsing errors.</li>
  </ul>
 </div>


</div></div></div></body></html>